package code.rocky.singleThreadExecution;

import java.util.concurrent.TimeUnit;

/**
 === BROKEN ===No.3: rocky : mei_Zhou
 === BROKEN ===No.3: rocky : mei_Zhou
 === BROKEN ===No.6: chen : ro_Zhou
 === BROKEN ===No.6: chen : ro_Zhou
 === BROKEN ===No.6: chen : ro_Zhou
 === BROKEN ===No.10: rocky : chen_Zhou
 === BROKEN ===No.10: rocky : chen_Zhou
 === BROKEN ===No.12: chen : mei_Zhou
 === BROKEN ===No.12: chen : mei_Zhou
 === BROKEN ===No.15: luo : mei_Zhou
 === BROKEN ===No.16: luo : ro_Zhou
 === BROKEN ===No.17: rocky : chen_Zhou
 **/
public class SafeGateTest {


    public static void main(String[] args) {
        SafeGate safeGate = new SafeGate();
        new UserThread(safeGate,new User("rocky", "lo_Zhou")).start();
//        new UserThread(safeGate,new User("luo","ruo_Zhou")).start();
        new Thread(()->{
            User user = new User("1", "1");
            try {
                TimeUnit.SECONDS.sleep(2);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("===  " + safeGate.toString());
        }).start();
//        new UserThread(safeGate,new User("chen","zhen_Zhou")).start();
    }
}
